solved string manipulation