added cost analysis and dist graph