reverse order since higher priority is coming first