removed intermediate registers into theta block to reduce number of registers used