Cleaned up the lightcrafter code. Need to test