More functional remaining function

Not really more efficient but more functional write with fold power , so more fun