Could probably break stuff down into smaller functions to help