Functions tested and working