Fixed minor bug in read() and also declare helper functions for populating and saving data structures TO/FROM disk