Add brackets analysis and interface for calculator