cleaned up code again