Add high-resolution detection

- clean up comments
- rename variables for clarity