updated main.py to use rect for positioning.