almost done, need to fill in error messages