increase performance of markets selection

(use bit operation insteed if-else)