Main function starts here. Calls some of the functions and interfaces.