Implmented texturing. Code might be a bit messy on some places.