into function handling - right now it is a mess.