Added functionality to return a function object instead of drawing in client's screen