begining to add temporal info and made code more modular.