Did some further clean and modification of variables name; this version compiles but does not run