WIP: registration stuff + masking