Added tests and flushed out functionality a bit more