updated code for newer pink api
continuing exploring