ld dir tidy up
Original implementation by @Wenri on Atlys using or1k added