Putting booleans in proper order