Code fully Functional for basic test case

Code ready to be sent to preliminary testign