the first part implementation