made more functional