Added parameters to algorithms and made changes acordingly