Submitted Version

Still has some small features missing, including the sorted array and
the reallocation of memory for the increasing size of array days