added link to paper, and reformatted code a bit