adding replace and copy, very hacky but approaching feature complete, will likely need a lot of refactoring and cleaning