updating range based for loops to use references & const references depening on necessary r/w access!
introduced range based for loops and did debugging
compiles now!