adding row elimination function