Updated weight checking function