Reverting Javascript to kayakr version - then can work backwards