starting work on algorithm.