Added integrate function