formatted the code to look slightly less shitty