first factorial java implementation