Added code for sanity check -- passes sanity check