Added onDrag event back in. Cleaned up some of the code