Fixing issues, adding documentation