byte MakeLookup(int index, bool rotate, bool flip) { if (index > 55) throw new IndexOutOfRangeException("Index out of range. Valid range 0-55"); if (rotate) index += 64; if (flip) index += 128; return (byte)index; }