realization of some simple algorithms