Code clean up and some code commenting.