Still trying to rearange so this works. only wants to work when I take the function part out.