Finished logic for in class lab.