moving javascript around