fixed ptr, added defines and defaul values