Got it to work!! Just need to redo the the orderMaterial at beginning and fix few bugs