replaced singularize method with own logic