Moved some of the lrs code around.