added flexi region constructor and made small changes to layout.js