Improved comments. Slightly tighter implementation, but no big changes.