improved documentation; modified header structure