Slow migration from shell to PHP. Sad I know.