cleaned up code - working on modal