initial texture mapping, minor bug fix