- added more error checking and acceptance test