Added thread allocation
Added thread allocation