fixed a bit I broke in a mild dissociative fit
cleaned up the files and added comments for assistance