some minor tweaks in createL and c++ code createL.cpp