implement subset sum