Cleaned up solution for 06242014 problem.