add deficiency & fix modularity