Refactored to use the Side enum instead of hard-coded left and right.