Added new functions

- added recognition of rest combinations (see previous comment)
- added preliminary calibration of playing field
- changed exit condition
- removed unused classes and variables