got equation working correctly