Add logging, fix prioritization