Problem 5: changed returned value int -> Optional<Integer>