cleaned up change priority, moved code to render where it belongs