Error fix by lecturer
Sequential code working
Implemented function to be parallelized