with Nick's solutions