NAL algorithm revised. Seems to be working well, but needs additional testing.