refactored replace_notations, refactored my method, added unit-test for my method