added some logical commens