added mutation and extensive debugging