some js solutions