working on writing Javascript