add implementation and documentation