everything compiles but the result is wrong