updated function for testing