bug in bilinear train function - fixed