add -Wall
fix int k scope
reorg dsum to arma
cleanup qc
armadilloize gk function
add newline
move rcovfn loop to separate function
drop mem bufs as passed args