loadDB: change in return value

now returns count of records
loadDB: smaller max record length
unique: bugfix

was modifying initial value
main.c: the whole logic added