added lighting, cleaned up code