Fixed that shit.
Added another, supposedly more correct solution to examine later.