checked compilation, problem with writing to stdio from inside a pure function, so commented the write statement out