figuring out why it won't work wit function