Put all functions together