Updated several algorithms