cleaned up code.