all functions tested and working