Add ability to sort by different things and update binary database file