make things final
Use a do { ... } while (); loop instead of recursion