current functions partially tested, working