Update main.cpp

Change optimization of data structs, const and comments