finished problem 4 in js text