updated some core logic to rotation