Added extensive documentation