Changed the structure to be more reasonable and also now the output messages give the user some idea what's happenening, unlike before.