Changed the 'end' variable