cleaned up code and moved to mouse clicked