initial version of code - pre MPI