modified combinations code - works, but not on large enough inputs