added hover and click events for boxes