some cleanup and fixes for comments on pull request
tabs to spaces and a few minor fixes