initial basic version imported from njsw2012