Implemented fromString method