breaked out some functions and sucked some dick