Added comments, additional functionality, mocha for testing