resorted based on time