Solution, but needs to have corner cases locked down.