added metadata support; more documentation