compiler works, and cleaned up code