fixed small bug on complement and pivot