added beta2 version with separation of the variables