Adding comments and code clean up
Code clean up and simplifications
More comments