Implemented main functionalities.