Modified StringPermute - cleaner / fewer lines of code