added standalone codes and demo