Eucledian algorithm