merged code into jason.lhs