Data transfer to main function