Convert the 4 SWState variables to a single array adding significantly less code