moved some definitions that were blatantly in the wrong place