improved placeString function... weird bug with some lines of input still