working in Euclid's solution for 005