Wokring, but f(x) needs more work