Added priority determination and comments