Create spelunk.m

Various minor improvements