changed correct input algorithm - now multiple solutions possible