Fixing some merge conflicts and added more comments