Tweaking to keep it functional.

Needs rewrite...