adding code with proper intendation and removing log comments