add constructor to read from string