functions merged