reading in thread

- reading coordinates from separated thread
- MainLoop refactoring