cleaned

Using already built functions instead of re-writing code... DRY!