main source code