slight modifications to fix bugs