Remove unused variable "mid"
Remove unused function "pos"
Merge pull request #235 from altearius/master

Remove stale code