4th  revision to programming assignment 2