added lead time handling, broke, simple ddply solution now