added orderMap and more Tests

Also fixed idx