restructured if statements for possible optimization
updated static initializer problems