Mohammed

Fixed some variable and method names, a few bugs and added some tests.