Formatting improvements and begun separating out different functions into different files.