Creating restructured text documentation

plus a small bug fix.