Fix style and make real lookup table functions for Dave