working on new solution
debugged, works now