Finished and tested the isVariable function.