Some tweaks and added comments