Combines result alert boxes together, makes it only show once at the end and gets rid of some irrelavant code from example code