added collision logic for ball against walls