Completed assignment, with sanity checks