Cleaned up code, tested through and fixed bugs, add command line implementation