Changed unsafe_view to @inbounds