Made slight improvement and changed 'N' function to take the new LOD system into consideration.