Fixed the variable code, replacing it with simpler arguments and using exceptions...