added all functions and a sample test