Add/fix semi/auto modes. Clean up code. Add comments.
Add wrap for kind, still not working yet.