fix z indexing and trig init function to match commit 33cde0e fixes to shallow_swap.c
fix z indexing and trig init function to match commit 33cde0e fixes to shallow_swap.c