adding private php variables read_preferences and slaveOkay and functions manipulating them