Cleaned code. Added support for texture IDs.