solved some test cases by adding REPLACE_ELEMENT as an option