1. Added comments for LUTs
2. Moved some function definitions to the header file