add version of TFP without priority queue with several arrays