Got more basic stuff working. Reworked the logic.