Restructure String algo. Add test case to String