Joes prob1 solution