altered activityfinder.js, added comments and structured it