added defs.h
use defs.h and some clearer names