Updated with comments and working perfectly