changed some types to ptrdiff_t
Working on composition