Tweaked class definitions and added more test