Reworked so that it is at least sorta working.