Removed warnings and added comments