cleaned up code: