functions filled in

lots of mistakes ^_^