Changed some variable names. Added some tests.