Finished main functionalities.