restructed to externalise JS, added texture images