a bunch of scala code for my own usage and testing.