Made main code structure.