Use is_inside instead of parts[part].inside