implemented internal variables.
I need to modify bilayer.cpp so that it transforms p array before adding some random values to initialize p.