Working solution, tests failing