Added sanity checks and analysis