add functions for reading and checking output