clean up whitespace, add custom sanity check