added lookuptable, removed useless code