Added more functional programming