Created a helper function to load a database for a particular value of N, removes code redundancy