created main fucn