Works but there may be a memory leak

Signed-off-by: Joe Buck <jbbuck@gmail.com>