How to build a time machine