changed to implement string parsing function