Added mouse events and optimized
minor change