fixed formatting, updated some code