Bug Fixes

Fixed r + mouse enter conflict.
Fixed mousedown + x conflict.

Also added comments and functions to clean up code.