First implementation, recursion and binary search