add armadillo support and change program structure