added layer weight functionality