implemented approximate p table in library