update minor algorithm errors