Solutions to programming exercises