added main sources and tests
added tests