algorithm update comments added