Removed unnecessary code
Added an algorithm to check whether a tree is balanced or not