added a sorted frame queue to display frames in correct order