Coursera Programming problem #2  rough stuff but it works