DONE COMMIT. 3.6. brackets are rewtitten using stacks