Updated formatting support

now works with the updated formatting, added comments to the while loop
explaining how it works, along with other comments and array/dict
formatting chnaged to a single line.