Made a sort of working maxFS function