added all basic functions and some comments