slight modifications to make it better