finish JS of the second part of module 6