added variable threads and block declarations with adaptive ids declaration