create function for drawing views