Better euclid and funkyMap implementations for Lab 8.