this version is functional, but it need to improve