documentation fix
simplify logic