code clean up. Add hard, semantic test