start filling out the algorithms