finished all functionalities