Made changes to level and  engine to avoid using pointers

Changes most pointer to references
Tested rules