really badly formatted quickly thrown together part12 TODO need to fix indenting but it works as its supposed to