correcting functions and such