added tailrec annotations
work revision: Pascal and balance works fine
work revision: balance works nice, need to read about scala test (see the TODO task), countChange is missing