Finish basic algorithms2