The variables are X for the filtered value, Q for the process noise, R for the sensor noise, P for the estimated error and K for the Kalman Gain. The state of the filter is defined by the values of these variables. The initial values for p is not very important since it is adjusted during the process. It must be just high enough to narrow down. The initial value for the readout is also not very important, since it is updated during the process. But tweaking the values for the process noise and sensor noise is essential to get clear readouts.