Added samples and documentation. Fixed some timing issues.