1st Cut

1st cut of checking of code. Need to be fully tested yet.