codemoving

moved some code around