add plot object
refactiring constructor