implemented more functional layout