Added boundschecking for blurring