add implementation of private algorithm