finish main functionalities