first function
yay! first working
second function mostly complete
third function