added condition and ident all code