P4Log2
- implemented the function