added method to compare two dates and return true if first comes before
the second