replace was changed to replaceAll to use regexp; first unit test was added