Working and tested last 4 functions