Added function order resolution for labels, doesnt yet support recursion
but it is a start