pulled in ace's changes and modified to work