more functional implemented