func val changed back to single integral