modified for more accurate calculation