Code:
L = L + 16
With this code, you are letting L overflow ... If L = 240 and you add 16, you get 0 (not 256). Bytes range from 0 – 255

If L = 0 to start

try something like this for the L increase routines:

Code:
IF L < 240 THEN
   L = L + 16
ELSE
   IF L = 240 THEN L = 255
ENDIF
try something like this for the decrease routines:

Code:
IF L > 0 THEN
   IF L = 255 THEN
	L = 240 
   ELSE
	L = L – 16
   ENDIF
ENDIF
You can work out something similar for the m variable. Reply back if you need more hints.