Newer version of code

Still some timing bugs