Implement dragging and clicking, comment some code