implement -attempts correctly, add --window