Modified JS to get functional conditions