Added logic for drawing the function graph. Polished graph appearance