fixed bug in calculate possibilities