properly sets up source path and main function