Updated lud function

Will modify [x] with solutions for [x].