Added more functional code