Finished the core functionality