Added gradual unit typing for functions, work in progress