rewrote stuff for pelican_ctrl.py