changed signs and corrected error