finish expand functionality