Logic (WIP)

I did a fair amount and then lost much of it.
Just uploading what I still have before I do anything else wrong...