updated mote code