More re-arrangement, still not working correctly