added output operation, reworked negative numbers