Fixed bugs, added console interface that handles everything