moving code to a better spot
Bug fixes