last 3 functions done.. but last 2 functions aren't tested in script i think