Re-write and Refactor.
Removed serveral un-used functions.
Renamed the file containing the core logic.
Merge branches 'master' and 're-write'