Adding further updated version of code. Nearing first working version. Currently in testing stage.