Trying to integrate a little

I can use Nrvan's code with minor edits