first part of codes