Changed position of a few functions