cleaned the code and did some mouse click tests