added code listings for the simple method