Updated error handling and returns of the functions using bools #2