main.cpp modified from sigmaplantas branch