An obvious implementation
Script for problem 2 is now executable.