Changed the draw rectangle to something a bit more generic