Made some improvements and further progress on Problem 18