Fixed wrong rotation order, removed redundant code