Changed the variable name in the histogram function and added the function checkvar1.