Implemented PB's calculation