Cleaned up some code and made a couple helpers. Now to decipher what you were thinking....