changed queue design
parallel version written