Got formations working, somewhat. Did some refactoring. May need to do more later on.