Added determination of rotation