pull out hacky function