last functions added befor its gettin really complicated for me