Initial commit. Main functions added.