added some layout fuctions and variable structure