Semi - final code
Final Code, and tested
samples