Made all functions except main private.