modified function phps