giant code sort; will be updated soon