debug added
refactored with let*