made second implementation