Added main function to call all other functions