incorporated notes from corey's code review