all functions implemented and compiling