updated structure and added tests for 1st problem