fixed memory leak, added comments, moved location of the ATB pannel