clean coding, still buggy