added data-structures and fixes for the test_first part