minor code corrections
beautified code