Updated source to reflect changes suggested by Paul Khuong.