implementing base and weight