try to implement algorithms