added timings function
various tests, cleanup