implements wrong answer javascript