Shuttle converter, written in Javascript