Javascript simple solution