cleaned up code and fixed weird hints