main functionalities finished