removed unnecessary parallel_z function. Made it an anonymous function