modify lib/attraction.js