removed some unnecessary lines of code and changed tests accordingly