working through javascript