minor changes to functioning version