I filled in a bunch of statefunctions

one or two of them I don't know how to do exactly,,those have been
commented as best as I could