Reorganized; also, fixed potential issue of space not being added at correct location.