added most of check_properties, and added error messages to other functions. also added tests