Added lines to algorithm