no more globals except $options!!!