updated for testing and returning values