Added more sample data
removed the data variable and replaced by parameters passed around (better testable)