Update main.cpp

Removed array codes, replaced with vector