worked on the functions some more