More code changes for master
Changed master code a little and made it neater