few changes to previous code