Update main.cpp

rectangular field support, may be buggy