Created polymorph function