changed syntax of the main function a bit