add sort algorithm
rm gate