Cleaned the code.
Added layers corresponding to the depth from the root.