One reason I say that is because you're using @ent, but we have no idea what that is. It could be defined earlier in the program, but we don't know that. If it is, tell us what it is. Also try to fix the indenting. That's too hard to read.