wrote out actual functionality