Consolidated code form Jay

Merged version of kondar.ca/testing/shahla/shahla3/
and kondar.ca/testing/jay/