formalize function for package building

lines 2-18
plotArray- addition of formal checks for input object|