fiexd sorting and queue input