fix bug and add documentation