Working version without image recognition