adding documentation, modifications to ensure it works as documentation declares