Slight reformat of code and added some extra printed lines