Code cleanup

fix indentation
clean up execute statements
add comments