Cleaned up and implemented mouse clicking