change cost function ( area not in block )