slight modifications made.