starting the algorithms