Work on permuting mechanism, grid lookup etc.