implemented scalar.jl