Added some tentative code for Rules 2 and 3, beginnings of some refactoring with structs