moved codes to upper position