output added, few changes in plotting