woo hoo got it to work
inner functions not working properly.