Updated some basic algorithms