finish writing js