moved around functions in maincpp

also update gitignore