deleted some useless code pieces. added some functions and checkers. created some tests(in progress). fixed some bugs