added rotation, reproduces theta=0 but segfault at theta>0