bracket logic done