For coursera programming assignment #2