You should have an array of priority bars, instead of 5 explicit ones. Would really clean all of this code up.