Figure producing code now written