added 1d support