updated drawing master function