moved minutes variable and made compute_next return the end_value