finalized calculations