Error checking and private variables