commented my code and fixed arithmetic begin variable