made file more usable as a lib