Working version, apart from some weird moves.