solved a few bugs. Added number_unique function