Simple weights function implemented