cleaned up errors, added iota error function