completed funtionality