add implementation of algorithms