code optimization and fixes

code optimization and fixes
+ optimization of code
+ cleaning of code
+ fixed some issues with tracking class
Merge pull request #41 from Conver/master

code optimization and fixes