fixed some formatting and added events