stripped no longer used code, changing order for readability