Clean up code and answered D