added upsampling function & test