refactor done
merge on refactors done
added some test to generation of priority number with less than 999 entries