first attempt for solving 623