this could be cleaned up a tad by setting this value once before this conditional rather than duplicating this code multiple times.