moved drawing to update function