Updated code

Nearing completion of code. Does not synthesize (array conversion
issues, investigating).