time loops

still not working: need to check indexing.