Adjusted HP code