begin SIMON code