Added polarity function for testing purposes (NOT FINAL)