tweaked to work with updated library