Add time class and improve sort method
Update main