fixed implementation of NOT