minor modifications to OLD version of nlj