cleaned code and added pplus field