fixed extra problems during
removed unused code. and made variable duration