Added rotation and try to better handle vectors (but seg fault)