Maxwell Interview Question

Possible improvements to your code