changed formatting of some let blocks for readability, added consistency