written all functions just need to compile