updated, compiles with warnings