Fixed prefix count bug. Added GNU license. Added comments.