added legend ncol option