first part of code