Updated drawing function.