Moved code around for symmetry