Fixing bug + adding doc