cleaned up master pic code