assignment #5 for Stanford's IOS course