Added client side button controls
Cleaning up of code