Lab 8: cleaned up source