a preliminary moving box function written. Testing through visualization shows how it goes wrong. Next step to fix that
Fixed looping bug.