working on material sort