adding non-networked code, sorry it's messy but it still requires a lot of work