Working on Graphics Exercises and Project Euler 31