fix testing inputs
re-write rendering method.

separate data manipulation and html rendering