first working version of the bilinear model