updated pp code