Fixed the skip mechanism, among other small fixes.  Also added copious comments.