Tail recursion optimization
Changed package names and class renamed