Adding 3 functions and general error proofing