fixed the shrink and swap bugs