updated manual, added error messages to functions