last two functions no longer commented out for testing