Add comments and debugged code'