Some code formatting based on suggestions on Github.