Changed priority logic