Movement code, minor other stuff