commented and bug-fixed buff