Added chnages suggested by Aaron Brewster
Applied some changes as suggested by Steven Cottrell