Joshua's code changes