refactored the drawTank method