priority naive implemented