Adding unittests
Reorganized data structure