finally got the #end correct from @adamrp
address comments from @eldeveloper and @adamrp