fixed some formatting and changed some functionality