changes to make the pattern more apparent and not hiding by explicitly stating through the constructor. also changed the -1 return for divide by zero to an exception