first attempt solution