Code cleanup and starting commenting