fLQ implementation, file 2