Implemented the integral. It works