completed a couple of functions, still a work in progress