Changed ensureAllAtomsAreInsideSystem to use if-tests instead of fmod