Answer for 4 (not yet efficient enough), created file for 5.

Also start log for keeping track of progress.