now calculates if previous node has been created, rather than querying. about to refactor to include day, hours and minutes in single tx