final cloudlet code