Imported code from the previous project.