Complete and debugged code.