Slightly changed the fn.js snippet