Added lookup-table for improved performance.

Signed-off-by: Lucas Arnström <lucasarstrom@gmail.com>