Implemented support for non tail-rec methods
minor refactoring
new test cases. Non tail recursion does not work in every case