Fully functional, needs more comments.

Written using Stanford string lib. Needs updating.