separate assign codes and app codes. add verbose debugging code