Fix undesired pass by refference issue; Add few inline comments