Changed constructor to perform the convertion