Beginning work on the logic