initial implementation of algorithmic function