finished coding the part that updates largest size/time. Only need to debug it.
helper function that I wrote to insert elements to a sorted javascript array.