Added greatest common divider algorithm