added separate function for reading X vector into parameters