FML this was hard