Added a proper parsing function.

No more C code :D