Lenwe

I think it's high time to merge this into master
DRY with previous function. Should be moved to another function.