quickly hacked out Problem 2 for three languages