Add index to Patch and refactor
The index is required to be able to remember what beam values belong to what patch. It's not yet used in this MR.
The index is required to be able to remember what beam values belong to what patch. It's not yet used in this MR.