working on eliminate func