Heterogeneous Agent Model With Real Business Cycle With Application In Optimal Tax Policy And Social Welfare Reform