cleaning up

Some code clean up and explanations done