commented all important sections of code