start reimplementing algorithms