finished DoS and added algo2