modified maxsub and added best time