"Basic helper code  + initial tests by Ashwin"