Changed the code to be more user-friendly.