Basic Logic

This is the basic logic and is subject to a lot of change.