beautify algorithm#1

1 job for algorithm in 4 minutes and 46 seconds