cleanup
removed typedefs
better incrementing through raw data