added functions and ready for test