added integral function