adding back foresight javascript