solution of problem with private functions