Code cleanup and more comments etc
Code cleanup and more comments etc