added functions and testing material