small fix
fixed major texture bug, some other fixes
minor changes throughout the code