added some better commenting and removed copyright info because its not relevant