Added some unit tests for function and parallel