Better integration algorithm