code and commenting cleanup