first version of get-sink-input-index