first partial implementation of lower layer (unstable)