A more formal understanding of functions