Removed warnings and add comments