code marked up by myles
god commit