implemented all basic functions