improved getConfiguration by having sum check