made some changes to allow for testing