finish all the functionality