added eval and some tidying