refactoring main.... breaking stuff
fixed the replace function... now replaces strings
starting to refactor main