Tried nesting letrec within if