Added many functions and many tests