clenup code and enable hints

fixed code to be pretty