count plug
reorder code