Register file nested if statements

removed repetitive lines